#### 第十三道题
#
# 有以下两个字典，请分别打印出两者的差异处(包括键和值)。

dict1 = {
  "pageSize": "30",
  "product": "EFund",
  "DISCOUNT": "",
  "SortColumn": "SYL_Y",
  "MobileKey": "4a69e1fc7d583fe671ad69c95ae6c2b7||945235770232353",
  "BUY": "true",
  "appType": "ttjj",
  "LevelOne": "",
  "version": "6.3.2",
  "onFundCache": "3",
  "Sort": "desc",
  "pageIndex": "1",
  "FundType": "6",
  "CompanyId": "",
  "plat": "Android",
  "TOPICAL": "",
  "ENDNAV": "",
  "LevelTwo": "",
  "ISABNORMAL": "true",
  "DataConstraintType": "0",
  "gToken": "ceaf-236567466abfda4e2864831ea5645231",
  "ESTABDATE": "6",
  "deviceid": "4a69e1fc7d583fe671ad69c95ae6c2b7||945235770232353"
}

dict2 = {
  "version": "6.3.2",
  "pageSize": "30",
  "product": "EFund",
  "DISCOUNT": "",
  "CLTYPE": "",
  "SortColumn": "SYL_Y",
  "MobileKey": "4a69e1fc7d583fe671ad69c95ae6c2b7||945235770232353",
  "BUY": "true",
  "appType": "ttjj",
  "RISKLEVEL": "",
  "igggggnoreburst": "true",
  "RLEVEL_SZ": "5,4,3",
  "Sort": "desc",
  "pageIndex": "1",
  "FundType": "0",
  "CompanyId": "",
  "plat": "Android",
  "TOPICAL": "",
  "ENDNAV": "",
  "ISABNORMAL": "true",
  "DataConstraintType": "0",
  "gToken": "ceaf-236567466abfda4e2864831ea5645231",
  "ESTABDATE": "6",
  "deviceid": "4a69e1fc7d583fe671ad69c95ae6c2b7||945235770232353"
}

differ = set(dict1.items()) ^ set(dict2.items())
print( "查看字典dict1和字典dict2不共有的键和值：")
print(differ)

print( "查看字典dict1和字典dict2共同的键和值" )
print (set(dict1.items()) & set(dict2.items()))


print( "查看字典dict1和字典dict2不共有的key" )
print (set(dict1.keys()) ^ set(dict2.keys()))

print( "查看字典dict1和字典dict2不共有的value" )
print (set(dict1.values()) ^ set(dict2.values()))

print ("查看在字典dict1里面而不在字典dict2里面的键和值:" )
print (set(dict1.items()) - set(dict2.items()))

print ("查看在字典dict2里面而不在字典dict1里面的键和值:" )
print (set(dict2.items()) - set(dict1.items()))

